import TabsView from '@/layouts/tabs/TabsView'
import BlankView from '@/layouts/BlankView'
import PageView from '@/layouts/PageView'

// 路由配置
const options = {
  routes: [
    {
      path: '/login',
      name: '登录页',
      component: () => import('@/pages/login')
    },
    {
      path: '*',
      name: '404',
      component: () => import('@/pages/exception/404'),
    },
    {
      path: '/403',
      name: '403',
      component: () => import('@/pages/exception/403'),
    },
    {
      path: '/',
      name: '首页',
      component: TabsView,
      redirect: '/login',
      children: [
        {
          path: 'dashboard',
          name: 'Dashboard',
          meta: {
            icon: 'dashboard'
          },
          component: BlankView,
          children: [
            {
              path: 'workplace',
              name: '工作台',
              meta: {
                page: {
                  closable: false
                }
              },
              component: () => import('@/pages/dashboard/workplace'),
            },
            {
              path: 'analysis',
              name: '分析页',
              component: () => import('@/pages/dashboard/analysis'),
            }
          ]
        },
        {
          path: 'role',
          name: '角色管理',
          meta: {
            icon: 'table',
            page: {
              cacheAble: false
            }
          },
          component: PageView,
          children: [
            {
              path: 'list',
              name: '角色列表',
              component: () => import('@/pages/role/'),
            },
            {
              path: 'form',
              name: '角色添加',
              meta: {
                highlight: '/role/form',
                invisible: false
              },
              component: () => import('@/pages/role/form/'),
            },
            {
              path: 'update/:id',
              name: '角色编辑',
              meta: {
                highlight: '/role/list',
                invisible: true
              },
              component: () => import('@/pages/role/form/'),
            },
            {
              path: 'detail/:id',
              name: '角色详细',
              meta: {
                highlight: '/role/list',
                invisible: true,
              },
              component: () => import('@/pages/role/detail/'),
            },

          ]
        },
        {
          path: 'user',
          name: '用户管理',
          meta: {
            icon: 'table',
            page: {
              cacheAble: false
            },
            authority: {
              type: "permission",
              permission: "system:user:page"
            }
          },
          component: PageView,
          children: [
            {
              path: 'list',
              name: '用户列表',
              component: () => import('@/pages/user/'),
              meta: {


              }
            },
            {
              path: 'form',
              name: '用户添加',
              meta: {
                highlight: '/user/form',
                invisible: false
              },
              component: () => import('@/pages/user/form/'),
            },
            {
              path: 'update/:id',
              name: '用户编辑',
              meta: {
                highlight: '/user/list',
                invisible: true
              },
              component: () => import('@/pages/user/form/'),
            },
            {
              path: 'detail/:id',
              name: '用户详细',
              meta: {
                highlight: '/user/list',
                invisible: true,
              },
              component: () => import('@/pages/user/detail/'),
            },

          ]
        },
        {
          path: 'permission',
          name: '权限管理',
          meta: {
            icon: 'table',
            page: {
              cacheAble: false
            }
          },
          component: PageView,
          children: [
            {
              path: 'list',
              name: '权限列表',
              component: () => import('@/pages/permission/'),
            },
            {
              path: 'form',
              name: '权限添加',
              meta: {
                highlight: '/permission/form',
                invisible: false
              },
              component: () => import('@/pages/permission/form/'),
            },
            {
              path: 'update/:id',
              name: '权限编辑',
              meta: {
                highlight: '/permission/list',
                invisible: true
              },
              component: () => import('@/pages/permission/form/'),
            },
            {
              path: 'detail/:id',
              name: '权限详细',
              meta: {
                highlight: '/permission/list',
                invisible: true,
              },
              component: () => import('@/pages/permission/detail/'),
            },

          ]
        },
        {
          path: 'template',
          name: '模板信息管理',
          meta: {
            icon: 'table',
            page: {
              cacheAble: false
            }
          },
          component: PageView,
          children: [
            {
              path: 'list',
              name: '模板信息列表',
              component: () => import('@/pages/template/'),
            },
            {
              path: 'form',
              name: '模板信息添加',
              meta: {
                highlight: '/template/form',
                invisible: false
              },
              component: () => import('@/pages/template/form/'),
            },
            {
              path: 'update/:id',
              name: '模板信息编辑',
              meta: {
                highlight: '/template/list',
                invisible: true
              },
              component: () => import('@/pages/template/form/'),
            },
            {
              path: 'detail/:id',
              name: '模板信息详细',
              meta: {
                highlight: '/template/list',
                invisible: true,
              },
              component: () => import('@/pages/template/detail/'),
            },

          ]
        },
        {
          path: 'generator',
          name: '代码生成',
          meta: {
            icon: 'cloud-download',
            page: {
              cacheAble: false
            }
          },
          component: () => import('@/pages/generator'),
        },
      ]
    },
  ]
}

export default options
